]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
misc: Fetch environment from launch context before spawn_async()
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 26 Oct 2023 14:03:44 +0000 (16:03 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 3 Nov 2023 20:47:44 +0000 (20:47 +0000)
This will fetch the right environment for the launched application,
without using GNOME Shell's environment.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2993>

js/misc/util.js

index 0201fd112721fd6460caddb6f24e879d95fa4ad6..de5e6d86185ee7bb24df5ae6490a528a222e63d7 100644 (file)
@@ -120,8 +120,9 @@ export function spawnApp(argv) {
 export function trySpawn(argv) {
     let success_, pid;
     try {
+        const launchContext = global.create_app_launch_context(0, -1);
         [success_, pid] = GLib.spawn_async(
-            null, argv, null,
+            null, argv, launchContext.get_environment(),
             GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD,
             () => {
                 try {